package file;

import java.io.File;

/**
 * java.io.File
 * File的每一个实例用于表示硬盘。。。。。
 */
public class FileDemo {
    public static void main(String[] args) {
        //    File file = new File("E:/jsd2403_SE");  //绝对路径
        File file = new File("./demo.txt");//相对路径

        String name = file.getName();
        System.out.println(name);
        long length = file.length();
        System.out.println(length);

        boolean cr = file.canRead();
        System.out.println("可读:"+cr);
        boolean cw = file.canWrite();
        System.out.println("可写:"+cw);

        /*
            hidden:隐藏
         */
        boolean h = file.isHidden();
        System.out.println("是否隐藏:"+h);
    }
}
